#include <iostream>
using namespace std;

int hammingDistance(int x, int y) {
    int s = x ^ y, res = 0;
    while (s) {
        res += (s & 1);
        s >>= 1;
    }
    return res;
}

int main() {
    int n, m;
    cin >> n >> m;
    cout << hammingDistance(n, m);
    return 0;
}

